<?php 

/** 
 * Abstract class for extension 
 */ 
//require_once '../Zend/View/Helper/FormElement.php'; 

/** 
 * FCKeditor PHP class 
 */ 
require_once 'extra/fckeditor/fckeditor.php'; 


/** 
 * Helper to generate a "textarea" element 
 * 
 * @category   Zend 
 * @package    Zend_View 
 * @subpackage Helper 
 */ 
class AML_View_Helper_FormRTE extends Zend_View_Helper_FormElement 
{ 
  
    public function formRTE($name = null, $value = null, $attribs = null) 
    { 
        
    	if(is_null($name) && is_null($value) && is_null($attribs)) { 
            return $this; 
        } 
         
        $info = $this->_getInfo($name, $value, $attribs); 
        extract($info); // name, value, attribs, options, listsep, disable 
		
        $editor = new FCKeditor($name); 
        // set variables
        $editor->BasePath   = 'http://'.$_SERVER['HTTP_HOST'] .'/extra/fckeditor/' ; 
        $editor->ToolbarSet = empty($attribs['ToolbarSet']) ? 'Basic' : $attribs['ToolbarSet']; 
        $editor->Width      = empty($attribs['Width']) ? '80%' : $attribs['Width']; 
        $editor->Height     = empty($attribs['Height']) ? 250 : $attribs['Height']; 
        $editor->Value      = $value;
        /*if(is_null($value))
		{
			$editor->Value = "_____";
		} else {
			$editor->Value = $value;	
		}*/
         
        // set Config  
        $editor->Config['BaseHref'] = $editor->BasePath;
        $editor->Config['CustomConfigurationsPath'] = $editor->BasePath.'editor/fckconfig.js'; 
        $editor->Config['SkinPath'] = $editor->BasePath.'editor/skins/silver/';         
        return $editor->createHtml(); 
         
    } 
         
}
